package com.cdut.util;

import org.junit.Test;

import java.util.Random;

import static java.lang.Math.pow;

/**
 * author: xinmu
 * date: 2022/4/23
 * time: 0:21
 */

public class VerificationCode {

    /**
     *
     * @return 四位随机数
     */
    public static int getVerificationCode(){

        int code = 0;

        for (int i = 0; i < 4; i++){
            code+=new Random().nextInt(9)*(int)pow(10,i);
        }

        return code;
    }

    @Test
    public void test(){
        System.out.println("".isEmpty());
    }
}
